package edu.polsl.bio.str.manager.service;

import edu.polsl.bio.str.common.api.DotPlotService;
import edu.polsl.bio.str.common.exception.ManagerException;
import edu.polsl.bio.str.common.messaging.StrDotsPayload;
import edu.polsl.bio.str.manager.logic.DotPlotBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * //todo class description
 * <p/>
 * Created on: Jun 13, 2011 12:51:20 PM <br/>
 * <a href="http://www.polsl.pl">www.polsl.pl</a>
 *
 * @author lukasz.olczak@polsl.pl
 */
public class DotPlotServiceImpl extends AbstractService implements DotPlotService {
  /**
   * slf4j Logger.
   */
  private static final Logger log = LoggerFactory.getLogger(DotPlotServiceImpl.class.getName());

  private DotPlotBean dotPlotBean;

  @Override
  public void sendResults(StrDotsPayload results) throws ManagerException {
    try {
      dotPlotBean.handleResults(results);
    } catch (Exception e) {
      log.error("Error while queueing str dots results " + results, e);
      throw createManagerException(e);
    }
  }

  public void setDotPlotBean(DotPlotBean dotPlotBean) {
    this.dotPlotBean = dotPlotBean;
  }
}
